<?php
include 'connect.php';
$query= mysql_query("select * from bacheca, utenti where bacheca.autore = utenti.id order by bacheca.id desc");
?>  

<div id="wrapper">
    	<div id="secWrapper">
        	<div id="container" class="clearfix">
            	<div id="mainCol" class="clearfix">
		    
		<h3 id="why">Bacheca</h3>
                    <ul id="maincon">
 		<?php
		while($query2 = mysql_fetch_array($query))
		{
		?>   
                    <li class="clearfix">
                    <img src="photos/<?php echo $query2['foto']; ?>" width="120" />
                    <h2><?php echo $query2['titolo']; ?></h2>
		<h1>Inserito da <?php echo ucwords($query2['nome'] . ' ' . $query2['cognome']) . ' il '. date("d-m-Y", strtotime($query2['data'])). ' alle '. date("H:i", strtotime($query2['ora']))  ; ?></h1><br>
                    <p align="justify"><?php echo $query2['testo']; ?></p>
                    </li>
		<?php
		}
		?>
                    </ul>

                </div>
                
